<% javascript_include_tag :all -%>
<div class="email-container">
  <div class="email-header">
    <div class="email-title">
      Email to friend
    </div>
    <div class="email-close" onclick="Dialog.okCallback();">
      <%=image_tag "close.jpg", :width=>"21", :height=>"21", :border=>"0", :align=>"right", :style=>"cursor:pointer;" -%>
    </div>
  </div>
  <div class="email-abuse">
    Email friends about
  </div>
  <div class="post-to-report">
    <%= @advertisment.title %>
  </div>
  <% form_for :email_ad, :url => {:controller=>"advertisments", :action => "email_friend" , :id => params[:id] } do |email_form| %>
  <div class="email-fields">
    <input type="text" name="yourname" value="Your name*" maxlength="30" size="25"/>
    <input type="text" name="youremail" value="E-mail ID*" maxlength="30" size="25"/>
  </div>
  <div class="email-friends1-fields">
    <input type="text" name="friendname" value="Friend's name*" maxlength="30" size="25"/>
    <input type="text" name="friendemail" value="Friend's E-mail ID*" maxlength="30" size="25"/>
    <div id="add-friends1" style="float:right">
      <%=link_to_function image_tag("add-friend.jpg", :width=>"20", :height=>"20", :border=>"0",:alt=>"Add more friends", :align=>"bottom")+"&nbsp;Add more friends" , "javascript:showdiv('email-friends1-fields1'),showdiv('add-friends1')"  -%>
    </div>
    <%= flash[:message]  %>
  </div>


  <div class="email-friends1-fields" id="email-friends1-fields1" style="display:none">
    <input type="text" name="friendname1" value="Friend's name*" maxlength="30" size="25"/>
    <input type="text" name="friendemail1" value="Friend's E-mail ID*" maxlength="30" size="25"/>
    <div id="add-friends2" style="float:right">
      <%=link_to_function image_tag("add-friend.jpg", :width=>"20", :height=>"20", :border=>"0",:alt=>"Add more friends", :align=>"bottom")+"&nbsp;Add more friends" , "javascript:showdiv('email-friends1-fields2'),showdiv('add-friends2')"  -%>
    </div>
  </div>

  <div class="email-friends1-fields" id="email-friends1-fields2" style="display:none">
    <input type="text" name="friendname2" value="Friend's name*" maxlength="30" size="25"/>
    <input type="text" name="friendemail2" value="Friend's E-mail ID*" maxlength="30" size="25"/>
    <div id="add-friends3" style="float:right">
      <%=link_to_function image_tag("add-friend.jpg", :width=>"20", :height=>"20", :border=>"0",:alt=>"Add more friends", :align=>"bottom")+"&nbsp;Add more friends" , "javascript:showdiv('email-friends1-fields3'),showdiv('add-friends3')"  -%>
    </div>
  </div>

  <div class="email-friends1-fields" id="email-friends1-fields3" style="display:none">
    <input type="text" name="friendname3" value="Friend's name*" maxlength="30" size="25"/>
    <input type="text" name="friendemail3" value="Friend's E-mail ID*" maxlength="30" size="25"/>
    <div id="add-friends4" style="float:right">
      <%=link_to_function image_tag("add-friend.jpg", :width=>"20", :height=>"20", :border=>"0",:alt=>"Add more friends", :align=>"bottom")+"&nbsp;Add more friends" , "javascript:showdiv('email-friends1-fields4'),showdiv('add-friends4')"  -%>
    </div>
  </div>

  <div class="email-friends1-fields" id="email-friends1-fields4" style="display:none">
    <input type="text" name="friendname4" value="Friend's name*" maxlength="30" size="25"/>
    <input type="text" name="friendemail4" value="Friend's E-mail ID*" maxlength="30" size="25"/>
  </div>



    <div class="email-message">
      <textarea name="message" rows="4" cols="54" class="text-class" wrap="virtual">Hi!
        I came across this ad and I think you might find it useful
        <% page = "http://localhost:3000/" + request.path_parameters['controller'] + "/show/" + params[:id] -%><%=page%>
      </textarea>
    </div>
    <div class="email-buttons">
        <%= image_submit_tag("send.jpg", :width=>"70", :height=>"24", :border=>"0",:alt=>"Send") -%>
        <%=image_tag "cancel.jpg" , :width=>"70px", :height=>"24px", :border=>"0px",  :alt=>"Cancel",:style=>"cursor:pointer;",:onclick=>"Dialog.okCallback();" -%>
    </div>
    <% end -%>
</div>